using System.Collections.Generic;
using Voodoo.Sauce.Core;
using Voodoo.Sauce.Internal.IntegrationCheck;

namespace Voodoo.Sauce.Internal.Analytics
{
	public class GameAnalyticsIntegrationCheck : IIntegrationCheck
	{
		private const string GANoIOSKeyError = "VoodooSauce Settings is missing iOS GameAnalytics keys";

		private const string GANoAndroidAndSecretKeyError = "VoodooSauce Settings needs both Android game and secret keys! Leave both fields empty to disable Android analytics";

		public List<IntegrationCheckMessage> IntegrationCheck(VoodooSettings settings)
		{
			List<IntegrationCheckMessage> list = new List<IntegrationCheckMessage>();
			bool flag = !string.IsNullOrEmpty(settings.GameAnalyticsIosGameKey) && !string.IsNullOrEmpty(settings.GameAnalyticsIosSecretKey);
			if ((!string.IsNullOrEmpty(settings.GameAnalyticsIosGameKey) || !string.IsNullOrEmpty(settings.GameAnalyticsIosSecretKey)) && !flag)
			{
				list.Add(new IntegrationCheckMessage(IntegrationCheckMessage.Type.ERROR, "VoodooSauce Settings is missing iOS GameAnalytics keys"));
			}
			bool flag2 = !string.IsNullOrEmpty(settings.GameAnalyticsAndroidGameKey) && !string.IsNullOrEmpty(settings.GameAnalyticsAndroidSecretKey);
			if ((!string.IsNullOrEmpty(settings.GameAnalyticsAndroidGameKey) || !string.IsNullOrEmpty(settings.GameAnalyticsAndroidSecretKey)) && !flag2)
			{
				list.Add(new IntegrationCheckMessage(IntegrationCheckMessage.Type.ERROR, "VoodooSauce Settings needs both Android game and secret keys! Leave both fields empty to disable Android analytics"));
			}
			return list;
		}
	}
}
